package com.kcs.common.utils;

import java.util.Locale;
import java.util.ResourceBundle;
import java.util.MissingResourceException;


public class PropsUtils {

	private static final Locale TH_LOCALE = new Locale("th");

	public static ResourceBundle getProps(String props) {

		ResourceBundle res = null;
		try {
			res = ResourceBundle.getBundle(props, TH_LOCALE);
		} catch(MissingResourceException e) {e.printStackTrace();}
		
		return res;
	}
	
	public static String getMessage(String props, String key) {
		
		ResourceBundle res = null;		
		res = getProps(props);
		if (res == null) return null;
		
		return res.getString(key);
	}

}